#include <iostream>
#include "simulator_sim.h"
#include "icnt_wrapper.h"
#include "pe.h"
#include <time.h>
int main()
{
	clock_t start,end;
start = clock();

	option_parser_t opp = option_parser_create();
	icnt_reg_options(opp);

	SimulatorConfig simulator_config;
	simulator_config.init(opp);

	SIMULATOR simulator(&simulator_config);
	simulator.init();

	do
	{
		simulator.cycle();
		simulator.simulator_sim_cycle++;
	} while (simulator.active());

	std::cout << "sim_cycles: " << simulator.simulator_sim_cycle << std::endl;
	(simulator.m_pes[0])->get_cache_hit_rate();
	//std::cout << "sim_cycles: " << 18688 << std::endl;

	std::cout << "number of executed instructions:" << (simulator.m_pes[0])->num_executed_ins << std::endl;
	end = clock();   //结束时间
	cout<<"time = "<<double(end-start)/CLOCKS_PER_SEC<<"s"<<endl;
	return 0;
}